package com.wn.sddfp.system.config;

import cn.hutool.crypto.digest.BCrypt;
import org.springframework.context.annotation.Bean;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Component;

@Component
public class PWDConfig {

    //导入依赖工具

    /**    加密工具
     *     <dependency>
     *             <groupId>org.springframework.security</groupId>
     *             <artifactId>spring-security-rsa</artifactId>
     *             <version>1.1.1</version>
     *      </dependency>
     *
     * @return
     */
    @Bean
    public PasswordEncoder passwordEncoder(){
        //所有的加密 工具 都可以 hutool 也可以
        return new BCryptPasswordEncoder();
    }

}